import http from "@/utils/http";
// 加入购物车
export const postMemberCart = (data) => {
    return http({
        url: '/member/cart',
        method: 'post',
        data
    })
}

// 获取购物车列表
export const getMemberCart = () => {
    return http({
        url: '/member/cart'
    })
}

// 修改购物车选中和未选中状态
// /member/cart/{id}
export const putMemberCart = (id, data) => {
    return http({
        url: `/member/cart/${id}`,
        method: 'put',
        data
    })
}

// 获取购物车数量
export const getMemberCartCount = () => {
    return http({
        url: '/member/cart/count'
    })
}


/**
 * 全选按钮
 */
export const putMemberCartSelected = (data) => {
    return http({
        url: '/member/cart/selected',
        method: 'put',
        data
    })
}

// 删除购物车 /member/cart
export const deleteMemberCart = (data) => {
    return http({
        url: '/member/cart',
        method: 'delete',
        data
    })
}